<%@ page import="java.util.*;" %>
<%@page contentType="text/plain" pageEncoding="UTF-8"%>
<%
    // print clues as a JSON string
    // For example,
    // [{"id": "1", "description": "this is a clue"}, {"id": "2", "description": "another clue"}]

            List<Map<String, String>> clues = (List<Map<String, String>>) request.getAttribute("clues");
            out.print("[");
            for (int i = 0; i < clues.size(); i++) {
                String id = clues.get(i).get("id");
                String description = clues.get(i).get("description");
                String jsonDict = String.format("{\"id\": \"%s\", \"description\": \"%s\"}", id, description);
                out.print(jsonDict);
                if (i + 1 < clues.size()) {
                    out.print(", ");
                }
            }
            out.print("]");
%>
